using System;
using Andshev.OrmTools.Linq2Query.Enumerations;

namespace Andshev.OrmTools.Linq2Query.Attributes
{
    [AttributeUsage(AttributeTargets.Property, Inherited = true)]
    public sealed class ForeignEntityAttribute : ColumnAttribute
    {
        public string ForeignColumnName { get; set; }

        public ForeignEntityAttribute(string columnName, bool required)
            : base(ColumnType.ForeignEntity, columnName, required)
        {
            ForeignColumnName = columnName;
        }

        public ForeignEntityAttribute(string columnName, string foreignColumnName, bool required)
            : base(ColumnType.ForeignEntity, columnName, required)
        {
            ForeignColumnName = foreignColumnName;
        }
    }
}